<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="dist/vue.js"></script>
</head>
<body>
    <div id="app">
       用户名：<input type="text" v-model.lazy="username" > {{ username }}
       <br/>
       密码：<input type="password" v-model="password"> {{ password }}
       <br/>
       性别：<input type="radio" v-model="sex" :value="1"> 男{{ sex === 1 ? '男': '女' }}
       <input type="radio" v-model="sex" :value="0"> 女{{ sex === 1 ? '男': '女' }}
       年龄: <input type="number" v-model="age"> {{ age }}
       <br/>
       爱好: <input type="checkbox" v-model="hobby" value="篮球">篮球
        <input type="checkbox" v-model="hobby" value="足球">足球
        <input type="checkbox" v-model="hobby" value="排球">排球 {{hobby}}
        <br/>
        <select v-model="lesson">
            <option disabled value="0">请选择</option>
            <option value="1">一阶段</option>  
            <option value="2">二阶段</option>        
            <option value="3">三阶段</option>        
        </select>{{lesson}}
        <br/>
        <textarea v-model="note"></textarea> {{note}}
        <br/><br/>
        备注:
        <input type="checkbox" v-model="flag">同意**协议
        <button :disabled="!flag" @click="getData">获取信息</button>
       
    </div>
</body>
<script>
    const app = new Vue({
        el: '#app',
        data: {
            username: 'lmx',
            password: 123456,
            sex: 1,
            age: 20,
            hobby:[],
            lesson:0,
            note:'',
            flag:false
        },
        methods: {
            getData() {
                console.log({
                    username:this.username,
                    password:this.password,
                    sex: this.sex,
                    age: this.age,
                    hobby: this.hobby,
                    lesson: this.lesson,
                    note: this.note,
                    flag: this.flag
                })
            }     
        }
    });
</script>
</html>